/**
 * 
 */
package co.fitstart.entity.product;

import com.demo2do.core.utils.Alias;

/**
 * @author Leo
 *
 */
@Alias("productStatus")
public enum Status {

    EDITING("编辑中","未上架", "editing", "warning"),
    
    ONLINE("上架","已上架", "online", "danger"),
    
    OFFLINE("下架","已下架", "offline", "success");
    
    private String description;
    
    private String des;
    
    private String alias;
    
    private String css;
    
    Status(String description,String des, String alias, String css) {
        this.description = description;
        this.des = des;
        this.alias = alias;
        this.css = css;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static Status aliasOf(String alias) {
        for (Status status : Status.values()) {
            if (status.getAlias().equalsIgnoreCase(alias)) {
                return status;
            }
        }
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isOnline() {
        return this.equals(ONLINE);
    }
    
    /**
     * 
     * @return
     */
    public String getDescription() {
        return description;
    }
    
    /**
     * 
     * @return
     */
    public String getDes() {
        return des;
    }
    
    /**
     * 
     * @return
     */
    public String getAlias() {
        return alias;
    }
    
    /**
     * 
     * @return
     */
    public String getCss() {
        return css;
    }
    
    public String getName() {
        return name();
    }
}
